<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>个人设置 - 归物</title>

    <!-- 网站图标 -->
    <link rel="icon" type="image/png" href="/icon.png">
    <link rel="shortcut icon" type="image/png" href="/icon.png">
    <link rel="apple-touch-icon" href="/icon.png">

    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
    <style>
        .navbar-brand {
            font-weight: bold;
            color: #007bff !important;
        }
        .profile-card {
            background: white;
            border-radius: 15px;
            box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        }
        .profile-header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 2rem;
            border-radius: 15px 15px 0 0;
            text-align: center;
        }
        .profile-avatar {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            background: rgba(255,255,255,0.2);
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 1rem;
            font-size: 2rem;
        }
        .info-item {
            padding: 1rem;
            border-bottom: 1px solid #e9ecef;
        }
        .info-item:last-child {
            border-bottom: none;
        }
        .info-label {
            font-weight: bold;
            color: #495057;
        }
        .info-value {
            color: #6c757d;
        }
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: white;
            border-top: 1px solid #dee2e6;
            z-index: 1000;
        }
        .bottom-nav .nav-link {
            color: #6c757d;
            text-align: center;
            padding: 0.75rem 0;
        }
        .bottom-nav .nav-link.active {
            color: #007bff;
        }
        .bottom-nav .nav-link i {
            font-size: 1.2rem;
            display: block;
            margin-bottom: 0.25rem;
        }
        .main-content {
            padding-bottom: 80px;
        }
    </style>
</head>
<body>
    <!-- 顶部导航栏 -->
    <nav class="navbar navbar-expand-lg navbar-light bg-light">
        <div class="container">
            <a class="navbar-brand" href="/dashboard">
                <i class="fas fa-boxes"></i> 归物
            </a>
            <div class="navbar-nav ms-auto">
                <div class="nav-item dropdown">
                    <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown">
                        <i class="fas fa-user"></i> <span th:text="${user.username}">用户</span>
                    </a>
                    <ul class="dropdown-menu">
                        <li><a class="dropdown-item" href="/profile"><i class="fas fa-user-cog"></i> 个人设置</a></li>
                        <li><hr class="dropdown-divider"></li>
                        <li>
                            <form th:action="@{/logout}" method="post" style="display: inline;">
                                <button type="submit" class="dropdown-item">
                                    <i class="fas fa-sign-out-alt"></i> 退出登录
                                </button>
                            </form>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </nav>

    <!-- 主要内容区域 -->
    <div class="main-content">
        <div class="container">
            <div class="row justify-content-center">
                <div class="col-md-8 col-lg-6">
                    <div class="profile-card mt-4">
                        <div class="profile-header">
                            <div class="profile-avatar">
                                <i class="fas fa-user"></i>
                            </div>
                            <h4 th:text="${user.username}">用户名</h4>
                            <p class="mb-0">个人设置</p>
                        </div>
                        
                        <div class="p-0">
                            <div class="info-item">
                                <div class="row">
                                    <div class="col-4">
                                        <span class="info-label">
                                            <i class="fas fa-user"></i> 用户名
                                        </span>
                                    </div>
                                    <div class="col-8">
                                        <span class="info-value" th:text="${user.username}">用户名</span>
                                    </div>
                                </div>
                            </div>
                            
                            <div class="info-item">
                                <div class="row">
                                    <div class="col-4">
                                        <span class="info-label">
                                            <i class="fas fa-envelope"></i> 邮箱
                                        </span>
                                    </div>
                                    <div class="col-8">
                                        <span class="info-value" th:text="${user.email != null ? user.email : '未设置'}">邮箱</span>
                                    </div>
                                </div>
                            </div>
                            
                            <div class="info-item">
                                <div class="row">
                                    <div class="col-4">
                                        <span class="info-label">
                                            <i class="fas fa-calendar"></i> 注册时间
                                        </span>
                                    </div>
                                    <div class="col-8">
                                        <span class="info-value" th:text="${#temporals.format(user.createdAt, 'yyyy-MM-dd HH:mm')}">注册时间</span>
                                    </div>
                                </div>
                            </div>
                            
                            <div class="info-item">
                                <div class="row">
                                    <div class="col-4">
                                        <span class="info-label">
                                            <i class="fas fa-clock"></i> 最后更新
                                        </span>
                                    </div>
                                    <div class="col-8">
                                        <span class="info-value" th:text="${#temporals.format(user.updatedAt, 'yyyy-MM-dd HH:mm')}">最后更新</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                        
                        <div class="p-3">
                            <div class="d-grid gap-2">
                                <button class="btn btn-outline-primary" disabled>
                                    <i class="fas fa-edit"></i> 编辑个人信息
                                </button>
                                <button class="btn btn-outline-secondary" disabled>
                                    <i class="fas fa-key"></i> 修改密码
                                </button>
                                <a href="/dashboard" class="btn btn-outline-info">
                                    <i class="fas fa-arrow-left"></i> 返回首页
                                </a>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 系统信息 -->
                    <div class="profile-card mt-3">
                        <div class="p-3">
                            <h6><i class="fas fa-info-circle"></i> 系统信息</h6>
                            <div class="row text-center">
                                <div class="col-6">
                                    <div class="text-muted">版本</div>
                                    <div class="fw-bold">v1.0.0</div>
                                </div>
                                <div class="col-6">
                                    <div class="text-muted">技术栈</div>
                                    <div class="fw-bold">Spring Boot</div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 底部导航栏 -->
    <div class="bottom-nav">
        <div class="container">
            <div class="row text-center">
                <div class="col-4">
                    <a href="/dashboard" class="nav-link">
                        <i class="fas fa-chart-line"></i>
                        <small>资产</small>
                    </a>
                </div>
                <div class="col-4">
                    <a href="/item/add" class="nav-link">
                        <i class="fas fa-plus"></i>
                        <small>添加</small>
                    </a>
                </div>
                <div class="col-4">
                    <a href="/profile" class="nav-link active">
                        <i class="fas fa-user"></i>
                        <small>我的</small>
                    </a>
                </div>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html> 